#!/bin/bash
wd=$(dirname $0)

srcf=$(${wd}/gputils.sh)/libgputils/gpprocessor.c
if [ -f ${srcf} ]
then
 proc=$(echo $1 | tr '[A-Z]' '[a-z]')
 if [ -n "${proc}" ]
 then

  egrep -e \"${proc}\" ${srcf} | awk -F, '{print $1}' | sed 's% *%%g; s%"%%g; s%.*_%%g' | tr '[A-Z]' '[a-z]'

 else
  cat<<EOF>&2
Usage

  $0 <proc>

Description

  Report architecture for processor, e.g. 'P16F873'.

EOF
  exit 1
 fi
else
 cat<<EOF>&2
Error, Missing source '${srcf}'.
EOF
 exit 1
fi
